#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg22000_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req22001
class Req22001:
	def __init__(self):
		self.protoid = 22001
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp22001
class Resp22001:
	def __init__(self):
		self.protoid = 22001
		self.status = 0
		self.teams = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		countteams = len(self.teams)
		writer.setArray(countteams, 2)
		for i in range(countteams):
			writer.setMessage(0)
			self.teams[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		for i in range(reader.getArray(2)):
			msg = TeamItem() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.teams.append(msg)
# message Req22002
class Req22002:
	def __init__(self):
		self.protoid = 22002
		self.teamId = 0
		self.type = 0

	def Marshal(writer):
		writer.setUint32(self.teamId, 1)
		writer.setUint32(self.type, 2)

	def Unmarshal( reader):
		self.teamId = reader.getUint32(1)
		self.type = reader.getUint32(2)
# message Resp22002
class Resp22002:
	def __init__(self):
		self.protoid = 22002
		self.status = 0
		self.team = TeamItem()

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		writer.setMessage(2)
		self.team.Marshal(writer)
		writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		reader.getMessage(2)
		self.team.Unmarshal(reader)
		reader.endGetMessage()
